package com.jiot.interceptor;

import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;

/**
 * 设置跨域支持
 */
public class AccessAllowInterceptor implements Interceptor {

	public void intercept(Invocation inv) {
		// 增加跨域支持响应头
		inv.getController().getResponse().addHeader("Access-Control-Allow-Origin", "*");
		inv.getController().getResponse().addHeader("Access-Control-Allow-Headers","X-Requested-With,token");
		inv.getController().getResponse().addHeader("Access-Control-Allow-Headers","X-Requested-With,phone");
		inv.invoke();
	}

}
